const axios = require('axios')
let _baseUrl = '/gateway/business/api'

//  获取分类树信息
export function getCategoryTreeByType (type) {
  const url = _baseUrl + `/category/getCategoryTreeByType?type=${type}`
  return axios.get(url).then((res) => {
    return Promise.resolve(res.data)
  })
}

//  保存分类
export function saveCategoryRelationList (data) {
  const url = _baseUrl + `/category/saveCategoryRelationList`
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}

//  获取关联最多的5个标签
export function getTopFiveRelationCategory (data) {
  const url = _baseUrl + `/category/getTopFiveRelationCategory`
  return axios.post(url, data).then((res) => {
    return Promise.resolve(res.data)
  })
}
